#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>

int main(void) {
	FILE *fp = fopen("1.txt", "rb+");
	if (fp == NULL) {
		printf("failed to open file.\n");
		exit(-1);
	}
	/*int ch;
	int count = 0;
	while ((ch = fgetc(fp)) != EOF) {
		count++;
		printf("%d = %c\n", count, ch);
	}
	printf("total = %d\n", count);*/
	fputc('a', fp);
	fputc('b', fp);
	fputc('\n', fp);
	fputc('1', fp);
	fputc('2', fp);
	
	fflush(fp);
	fclose(fp);
	return 0;
}